<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Connectivity Middleware Utilities Library: String conversion functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="cypress_logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Connectivity Middleware Utilities Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__string__func.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">String conversion functions<div class="ingroups"><a class="el" href="group__group__utils.html">Common middleware utilities</a> &raquo; <a class="el" href="group__string__utils.html">String conversion utilities</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >The string utilities module is a collection of string conversion helpers to convert between integer and strings. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga98fd7b096c4a81eebf0955b0b32c86b5"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__string__func.html#ga98fd7b096c4a81eebf0955b0b32c86b5">cy_generic_string_to_unsigned</a> (const char *str)</td></tr>
<tr class="memdesc:ga98fd7b096c4a81eebf0955b0b32c86b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a decimal or hexidecimal string to an integer.  <a href="group__group__string__func.html#ga98fd7b096c4a81eebf0955b0b32c86b5">More...</a><br /></td></tr>
<tr class="separator:ga98fd7b096c4a81eebf0955b0b32c86b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga430e6dd6a7c7742d6519d590df60ddfb"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__string__func.html#ga430e6dd6a7c7742d6519d590df60ddfb">cy_string_to_signed</a> (const char *string, uint16_t str_length, int32_t *value_out, uint8_t is_hex)</td></tr>
<tr class="memdesc:ga430e6dd6a7c7742d6519d590df60ddfb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a decimal/hexidecimal string (with optional sign) to a signed long int Better than strtol or atol or atoi because the return value indicates if an error occurred.  <a href="group__group__string__func.html#ga430e6dd6a7c7742d6519d590df60ddfb">More...</a><br /></td></tr>
<tr class="separator:ga430e6dd6a7c7742d6519d590df60ddfb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaef4a65ee7f6454d38bdb5342ed24089e"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__string__func.html#gaef4a65ee7f6454d38bdb5342ed24089e">cy_string_to_unsigned</a> (const char *string, uint8_t str_length, uint32_t *value_out, uint8_t is_hex)</td></tr>
<tr class="memdesc:gaef4a65ee7f6454d38bdb5342ed24089e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a decimal/hexidecimal string to an unsigned long int Better than strtol or atol or atoi because the return value indicates if an error occurred.  <a href="group__group__string__func.html#gaef4a65ee7f6454d38bdb5342ed24089e">More...</a><br /></td></tr>
<tr class="separator:gaef4a65ee7f6454d38bdb5342ed24089e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga98fd7b096c4a81eebf0955b0b32c86b5" name="ga98fd7b096c4a81eebf0955b0b32c86b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga98fd7b096c4a81eebf0955b0b32c86b5">&#9670;&nbsp;</a></span>cy_generic_string_to_unsigned()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cy_generic_string_to_unsigned </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert a decimal or hexidecimal string to an integer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>The string containing the value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The value represented by the string. </dd></dl>

</div>
</div>
<a id="ga430e6dd6a7c7742d6519d590df60ddfb" name="ga430e6dd6a7c7742d6519d590df60ddfb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga430e6dd6a7c7742d6519d590df60ddfb">&#9670;&nbsp;</a></span>cy_string_to_signed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t cy_string_to_signed </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>str_length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>value_out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>is_hex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts a decimal/hexidecimal string (with optional sign) to a signed long int Better than strtol or atol or atoi because the return value indicates if an error occurred. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">string</td><td>: The string buffer to be converted </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">str_length</td><td>: The maximum number of characters to process in the string buffer </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">value_out</td><td>: The unsigned in that will receive value of the the decimal string </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">is_hex</td><td>: 0 = Decimal string, 1 = Hexidecimal string</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of characters successfully converted (including sign). i.e. 0 = error </dd></dl>

</div>
</div>
<a id="gaef4a65ee7f6454d38bdb5342ed24089e" name="gaef4a65ee7f6454d38bdb5342ed24089e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaef4a65ee7f6454d38bdb5342ed24089e">&#9670;&nbsp;</a></span>cy_string_to_unsigned()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t cy_string_to_unsigned </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>str_length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>value_out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>is_hex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts a decimal/hexidecimal string to an unsigned long int Better than strtol or atol or atoi because the return value indicates if an error occurred. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">string</td><td>: The string buffer to be converted </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">str_length</td><td>: The maximum number of characters to process in the string buffer </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">value_out</td><td>: The unsigned in that will receive value of the the decimal string </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">is_hex</td><td>: 0 = Decimal string, 1 = Hexidecimal string</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of characters successfully converted. i.e. 0 = error </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Connectivity Middleware Utilities Library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
